<?php
require_once (APPLICATION_DIR."/application/model/Link.php");

class Link extends DataObjects_Link
{
		function addLink($p_arrForm)
		{
			$this->link_name      = $p_arrForm['link_name'];
			$this->link_title   = $p_arrForm['link_title'];
			$this->link_url     = $p_arrForm['link_url'];
			$this->insert();
		}
    function getAllLinkInfo()
    {
        $this->selectAdd();
        $this->selectAdd("*");
        $this->find();
        return $this;
    }
    
    function getLinkInfoByID($link_id)
    {
        $this->selectAdd();
        $this->selectAdd("*");
        $this->whereAdd();
        $this->whereAdd("link_id = $link_id");
        $this->find();
        return $this;
    }
    
    function updateLink($link_id,$link_title,$link_url)
    {
        $this->link_id      = $link_id;
        $this->link_title   = $link_title;
        $this->link_url     = $link_url;
        $this->update();
    }
    
    function getAllLink()
    {
        $this->find();
        return $this;
    }
}
?>